/**
 * 静态内部类
 */
class OuterClass2{
    public int data1 = 10;
    public int data2 = 20;
    public static int data3 = 23;

    // 静态内部类 -- 相当于一个实例变量
    static class InnerClass2 {
        public int data1 = 22;
        public int data3 = 90;
        public static int data4 = 90;

        public InnerClass2() {
            System.out.println("InnerClass:: 无参构造方法");
        }

        public void test() {
            System.out.println("InnerClass:: test()");
            // 要访问外部类中的同名变量
            System.out.println(new OuterClass2().data1);
            System.out.println(new OuterClass2().data2);
            System.out.println(OuterClass2.data3);
            System.out.println(data1);
            System.out.println(data3);
            System.out.println(data4);
        }
    }
}
public class TestDemo2 {
    public static void main(String[] args) {
        OuterClass2.InnerClass2 inner = new OuterClass2.InnerClass2();
        inner.test();
    }
}